feat(infra): block curly quotes#2414
Conversation
| name: Check for curly quotes | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Check for curly quotes | ||
| run: | | ||
| chmod +x scripts/check_curly_quotes.sh | ||
| ./scripts/check_curly_quotes.sh |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
In general, the fix is to add an explicit permissions block to the workflow (either at the top level so it applies to all jobs, or directly under the specific job) and restrict GITHUB_TOKEN to the least privileges required. This workflow only checks out the repository and runs a script, so contents: read is sufficient.
The best minimally invasive fix here is to add a job-level permissions block under check-curly-quotes: specifying contents: read. This keeps the change tightly scoped to the job that CodeQL flagged and avoids assumptions about other jobs (none are shown). Concretely, in .github/workflows/check-curly-quotes.yml, under jobs: check-curly-quotes: name: Check for curly quotes, insert a permissions: mapping with contents: read at the standard indentation level. No imports or other definitions are needed; this is pure workflow configuration.
| @@ -14,6 +14,8 @@ | ||
| check-curly-quotes: | ||
| name: Check for curly quotes | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout code |
|
Mintlify preview ID generated: preview-mdrxyc-1769799350-4025b53 |
leaving here, would love for member of docs team to take over or close
CURLY_QUOTE_PATTERNis wrong